<?php
/**
 * 域名模型
*/

namespace app\common\model;

use think\model\concern\SoftDelete;

class Domain extends CommonBaseModel
{
    use SoftDelete;
    // 自定义选择数据
    

    protected $name = 'domain';
    protected $autoWriteTimestamp = true;

    // 可搜索字段
    public array $searchField = [];

    // 可作为条件的字段
    public array $whereField = [];

    // 可作为多选条件的字段
    public array $multiWhereField = [];

    // 可做为时间
    public array $timeField = [];

    public function getselect(){
        $domainData = Domain::where('status',1)->select();
        foreach($domainData as $k => $v){
            $count = Page::where('domain',$v['url'])->count();
            $domainData[$k]['count'] = $count;
        }
        return $domainData;

    }

    

}
